<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>

<body>
    <div id="time">2022-05-22</div>

    <script>
        //因为我们文档DOM从上向下加载，得现有标签，js需要写在下面
        var timer = document.getElementById('time');
        console.log(timer);
        console.log(typeof timer);//返回的是一个元素对象
        console.dir(timer);//打印我们返回的元素对象 更好的查看里面的详细属性和方法
    </script>
</body>

</html>